<%@page import="com.rocky.ssm.model.Students"%>
<%@page import="com.rocky.ssm.dao.stuBaseDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>根据姓名查询</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
		/* 去掉超链接下划线 */
		a{
			text-decoration: none;
		}
		/*查询样式*/
		#queryByName{
			background-color: rgb(217,237,247);
			padding: 4 0;
		}
	</style>
	<!--引入jQuery  -->
	<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
	<!-- 设置查询学员输入框样式 -->
	<script type="text/javascript">
		$(function(){	
			$("input[name='stu_name']").focus(function(){
				if($(this).val()=="请输入学员姓名") {
					$(this).val("");
				
				}
				
			}).blur(function(){
				
				if($(this).val()==null || $(this).val()=="") {
					$(this).val("请输入学员姓名");
				
				}
			
			});
	
		});
	
	
	
	</script>
  </head>
  
  <%
  	//1设置编码
  	request.setCharacterEncoding("utf-8");
  	response.setCharacterEncoding("utf-8");
  	//2 接收参数
  	String stu_name = request.getParameter("stu_name");
  	
  	//3 调用根据姓名查询的方法getStuByNames()
  	stuBaseDao sbd = new stuBaseDao();
  	Students students = sbd.getStuByName(stu_name);
  
   %>
 
  <body>
    	<div style="background-color: rgb(242,242,242);padding: 4 0 ">学员管理/查询学员</div>
    	<div id="queryByName">学员姓名：<input type="text" value="请输入学员姓名"  name="stu_name"> <button style="background-color: red;"><a href="#">查询</a></button>   <button style="background-color: rgb(92,184,92); "><a href="stu_add.jsp">添加学员</a></button> <br/></div>
    	
    	
    	<table border="1" align="center" width="85%">
    		<thead>
    			<tr>
    				<th>编号 </th>
    				<th>姓名</th>
    				<th>性别</th>
    				<th>年龄</th>
    				<th>手机号码</th>
    				<th>电子邮件</th>
    				<th>所在院校</th>
    				<th>学员缴费</th>
    				<th>操作</th>
    			</tr>
    		</thead>
    		
    		<tbody>
    		<!--  循环遍历list集合取值-->
    		<%
    			
    	
    		 %>
    			<tr>
    				<td align="center"><%=students.getStuName()%></td>
    				<td align="center"><%=students.getStuId()%></td>
    				<td align="center"><%=students.getStuGender()%></td>
    				<td align="center"><%=students.getStuAge()%></td>
    				<td><%=students.getStuTel()%></td>
    				<td><%=students.getStuEmail()%></td>
    				<td><%=students.getStuSchool()%></td>
    				<td align="center"><a href="#">学员缴费</a></td> 
    				<td><a href="stu_update.jsp?stu_id=">修改</a> | <a href="stu_del.jsp?stu_id=">删除</a></td> 			
    			</tr>
    		<%
    			
    		 %>
    		</tbody>
    	
    	
    	</table>
    	 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
  </body>
</html>
